﻿/**
 * @author Administrator
 */
/**
 * 添加经办人员到下拉列表框
 * @param {Object} t
 * @param {Object} v
 */
function addToSelect(t, v){
    try {
        var mystate = false;
        var mysele = document.getElementById('zhuban');
        for (i = 0; i < mysele.options.length; i++) {
            if (mysele.options[i].value == v) {
                mysele.removeChild(mysele.options[i]);
                mystate = true;
            }
        }
        if (!mystate) {
            var myop = new Option();
            myop.innerHTML = t;
            myop.value = v;
            mysele.appendChild(myop);
        }
    } 
    catch (e) {
        alert(e.message);
    }
}

/**
 * 检查提交一下步信息
 */
function checkToNext(){
    var nextstate = false;
    var zhubanstate = false;
	var have = false;
    var mynext = document.getElementsByTagName("input");
    var mysele = document.getElementById("zhuban");
    for (var i = 0; i < mynext.length; i++) {
        if (mynext[i].type == "radio" && mynext[i].name == "nextid") {
			have = true;
            if (mynext[i].type == "radio" && mynext[i].name == "nextid" && mynext[i].checked == true) {
                nextstate = true;
            }
        }
    }
    if (mysele.options.length > 0) {
        zhubanstate = true;
    }
    if (have == true && nextstate == false) {
        alert("请选择下一步骤！");
        return false;
    }
    if (zhubanstate == false) {
        alert("请选择主办人！");
        return false;
    }
    return true;
}
